<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>成长日历</title>
<script type="text/javascript" src="Public/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="Public/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="Public/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="Public/bootstrap/css/bootstrap-responsive.css">
<link href="theme/default/css/fullcalendar.css" media="screen" rel="stylesheet" type="text/css">
<link href="theme/default/css/common.css" type="text/css">
<link rel="stylesheet" href="Public/css/homeindex.css">

<script type="text/javascript" src="Public/artDialog/artDialog.source.js?skin=default" charset="utf-8"></script>
<script type="text/javascript" src="Public/js/jquery.ae.image.resize.min.js"></script>
<script type="text/javascript" src="Public/js/jquery-anchorGoWhere.js"></script>
<script type="text/javascript" src="Public/js/jquery.date.js"></script>
  <!--[if lte IE 6]>
  <link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/bootstrap-ie6.css">
  <![endif]-->
  <!--[if lte IE 7]>
  <link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/ie.css">
  <![endif]-->


<script type="text/javascript">
var babyInfo = <?php echo json_encode($_SESSION['session_fb'][$_SESSION['session_babyid']]);?>


</script>
<style type="text/css">
#calendar{width:778px; overflow:hidden;margin-top: 60px; position:relative}
body{
background-repeat: repeat-x;
background-position: center 0;
background-color:#1a1d40;
background-image: url("/theme/default/images/body_bg.jpg");	
}

/**/
.cal_top_mon, .cal_m_container {
min-width: 770px;
}
.cal_top {
overflow: hidden;
}
.cal_top ul li{
	list-style:none	
}
.cal_top ul li a{
	text-indent:-2000em;
}

.right, .qm_right {
float: right;
margin-top:15px;
margin-right:10px;
}
.view_type li {
float: left;
}
.cal_top .right .btn_gray {
float: left;
}
.currpage a.btn_gray {
border-color: #919191;
border-top-color: #494949;
border-bottom-color: #919191;
_overflow: hidden;
cursor: default;
color: white!important;
background: #494949;
background: -moz-linear-gradient(top,#494949,#919191);
background: -webkit-linear-gradient(top,#494949,#919191);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#494949',endColorstr='#919191');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#494949',endColorstr='#919191')";
}
.cal_month a.btn_gray {
border-radius: 3px 0 0 3px;
margin-right: 0;
}
.view_type a.btn_gray {
width: 56px;
padding: 0;
text-align: center;
}
.cal_day a.btn_gray {
border-radius: 0;
border-left: 0px;
}
.view_type a.btn_gray {
width: 56px;
padding: 0;
text-align: center;
}
.g_title {
text-align: center;
margin: 0 225px 0 145px;
}
a.btn_next, a.btn_pre {
position: relative;
top: 3px;
display: inline-block;
width: 20px;
height: 18px;
line-height: 18px;
margin: 0 10px;
border: 1px solid transparent;
_border-color: tomato;
_filter: chroma(color=tomato);
}
.g_title h1 {
display: inline-block;
width: 185px;
text-align: center;
color: #2A4564;
font-size: 20px;
line-height: 26px;
font-family: "Microsoft Yahei";
}
a.btn_gray {
display: inline-block;
height: 22px;
line-height: 22px;
line-height: 24px	url(\0);
_overflow: hidden;
padding: 0 12px;
margin: 0;
text-align: center;
border-radius: 3px;
}
.cal_top .left a {
float: left;
margin-right: 5px;
}
a {
text-decoration: none;
cursor: pointer;
outline: none;
}


a.btn_pre .arrow_l {
margin: 4px 0 0 6px;
}


a.btn_next, a.btn_pre {
position: relative;
top: 3px;
display: inline-block;
width: 20px;
height: 18px;
line-height: 18px;
margin: 0 10px;
border: 1px solid transparent;
_border-color: tomato;
_filter: chroma(color=tomato);
}
a.btn_next .arrow_r, a.btn_pre .arrow_l {
margin: 4px 0 0 6px;
}

.arrow_l, .arrow_r {
display: block;
background: url(/Public/images/ico_calendar104473.png) no-repeat;
width: 8px;
height: 9px;
overflow: hidden;
}
.arrow_r {
background-position: -96px 0;
}
.arrow_l {
background-position: -64px 0;
}
a.btn_next:hover, a.btn_pre:hover {
border: 1px solid #BEBEBE;
border-radius: 3px;
background: #DDD url(/Public/images/buttonbg104472.png) repeat-x 0 -128px;
}
.imgshadow{
display: block;
border: none;
opacity: 0.5;
-moz-box-shadow: 2px 2px 4px #8e8e8e;
-webkit-box-shadow: 2px 2px 4px #8e8e8e;
box-shadow: 2px 2px 4px #8e8e8e;
}
#album_show_day{
	width:207px;
	height:410px;
	overflow:hidden;
	background:#fff;
	position:absolute;
	left:2px;
	top:40px;
}
#album_show_day ul{list-style-type: none;margin:0;padding:0}
#album_show_day ul li{float:left;width:50px;height:50px;overflow: hidden;
margin:1px;}
#calendar_body a:link,#calendar_body a:visited{
		
}
#calendar_body a:hover{
	text-decoration:none
}
.pp_sidebar{
padding-top: 14px;
padding-right: 14px;
position: absolute;
top: 0;
right: 0;
width: 302px;
min-height: 100px;
z-index: 8007;
text-align: left;
height: 626px;	
}

.mark_wraper ul{
list-style-type: none;margin:6px;padding:0	;
overflow:hidden
}
.mark_wraper ul li{
float:left;	
}

h2.dayTitle {
margin-bottom: 10px;
padding: 0 10px;
line-height: 30px;
font-size: 14px;
border-bottom: solid 1px #CCC;
}

.photo_figure{
width:960px;
overflow:hidden;
margin:0 auto;
position:relative;
}
.figure_area {
min-width: 270px;
_width: 270px;
width:740px;
height: 580px;
position: relative;
overflow: hidden;
float:left;
}
#gallery li{
	float:left;
	list-style:none;
}
a.link_view:link,a.link_view:visited{
	display:block;
	border:2px solid #ff6600;
}

.figure_side {
text-align: left;
width: 220px;
height: 580px;
padding: 0 25px;
overflow-y: auto;
overflow-x: hidden;
position: absolute;
right: 0;
top: 0;
background: #ECECEC;
}
.figure_slidview{
width:950px;
overflow:hidden;
margin:0 auto;
height: 55px;
}

#tooltip{ 
position:absolute; 
border:1px solid #333; 
background:#f7f5d1; 
padding:2px 5px; 
color:#333; 
display:none; 
}
.left-img{
cursor:url(/Public/images/pre.cur),auto;	
}
.right-img{
	cursor:url(/Public/images/next.cur),auto;
}
.photo_layer_close {
position: absolute;
z-index: 10;
right: -8px;
top: -8px;
height: 40px;
width: 40px;
line-height: 150px;
overflow: hidden;
}
.photo_layer_close a {
display: block;
height: 42px;
width: 42px;
overflow: hidden;
background-image: url(/Public/images/photo_scan_layer-32.png);
background-position: 0 0;
_background-image: url(/Public/images/photo_scan_layer-ie6.png);
_background-position: 0 0;
cursor: pointer;
}

.figure_side .user {
padding: 25px 0 8px;
width: 220px;
padding-bottom: 7px;
border-bottom: solid 1px #E0E0E0;
}
.figure_side .user_img {
width: 40px;
float: left;
}
.figure_side .user_img a {
display: block;
height: 40px;
width: 40px;
}
.figure_side .user_photo_details {
float: left;
margin-left: 10px;
width: 155px;
line-height: 19px;
}
.figure_side .user_photo_details p {
white-space: nowrap;
width: 152px;
overflow: hidden;
text-overflow: ellipsis;
}
.figure_side .figure_description {
line-height: 24px;
margin-bottom: 6px;
width: 220px;
position: relative;
}
.detailStats {
height: 34px;
}	
.sendButton {
float: right;
}	
.addComment {
height: 40px;
background: white;
margin-bottom: 5px;
width: 208px;
padding: 5px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 12px;
line-height: 18px;
color: #333;
outline: none;
resize: none;
}


.guess-list {
overflow: hidden;
border: 1px solid #EEEBE7;
border-top: 0;
border-left: none;
/*width:654px;*/
margin:0 auto;
}

.item-a, .item-b, .item-c {
margin-bottom: -1000px;
padding-bottom: 1000px;
border-top: 1px solid #EEEBE7;
background: url(/Public/images/bg_line.png) repeat-y 0 0;
}
.item-b, .item-c {
display: inline-block;
zoom: 1;
vertical-align: top;
letter-spacing: normal;
word-spacing: normal;
*display:inline; 
*zoom:1;
}
.main{margin-top:10px;}
.guess-list .item-a, .guess-list .item-c {
width: 218px;
overflow: hidden;
_width:200px

}
.guess-list .online-desc .pics {
letter-spacing: -0.31em;
word-spacing: -0.43em;
margin:0 0 15px 25px
}
.guess-list .online-desc .pics li {
display: inline-block;
width:52px;
max-height: 50px;
_height: 50px;
overflow: hidden;
letter-spacing: normal;
word-spacing: normal;
font-size: 0;
vertical-align: top;
margin: 0 4px 4px 0;
list-style:none;
*display:inline; 
*zoom:1; 
}
.guess-list .online-desc .pics li img{
width:50px;
height:38px;
opacity:0.6;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=40);
border:1px solid #ccc;
    -moz-box-shadow:0px 0px 10px #111;
    -webkit-box-shadow:0px 0px 10px #111;
    box-shadow:0px 0px 10px #111;

}
.guess-list .title {
margin: 0 0 12px 0;
color: #666;
line-height: 1.4;
}
h3 {
height: 26px;
margin-left: 4px;
font: 14px Arial,Helvetica,sans-serif;
color: #666;
margin-bottom: 1px;
line-height: 1.62;
background-color: #F2FBF2;
}
.guess-list .group h3 {
height: auto;
margin: 0;
line-height: 1.3;
background: 0;
color: #333;
}
.guess-list .source {
margin-top: 10px;
color: gray;
}
.guess-list .title {
margin: 0 0 12px 0;
color: #666;
line-height: 1.4;
}
.guess-list .fav-btn {
padding: 0 25px 25px 25px;
margin-top: -10px;
white-space: nowrap;
}
.fav-btn a {
display: inline-block;
zoom: 1;
padding: 5px 6px;
line-height: 1.2;
font-weight: 800;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}
.fav-btn a:link, .fav-btn a:visited {
color: #CA6445;
background: #FAE9DA;
}

.figure_area_handle {
height: 37px;
width: 150px;
position: absolute;
bottom: 0;
left: 50%;
margin-left: -75px;
}
.figure_area_handle p {
float: left;
width: 50px;
height: 37px;
cursor: pointer;
}
.figure_area_handle p a {
display: block;
height: 37px;
width: 50px;
overflow: hidden;
background: #000;
filter: Alpha(Opacity=60);
opacity: .6;
cursor: pointer;
}
.figure_area_handle p.left_rotation a span {
	display:block;
width: 27px;
height:24px;
margin: 7px 11px 0;
background-image: url(/Public/images/photo_scan_layer-32.png);
background-position: -82px -25px;
_background-image: url(/Public/images/photo_scan_layer-ie6.png);
_background-position: -41px -50px;
}
.figure_area_handle p.right_rotation a span {
		display:block;
width: 27px;
height:24px;
margin: 7px 13px 0;
background-image: url(/Public/images/photo_scan_layer-32.png);
background-position: -138px -25px;
_background-image: url(/Public/images/photo_scan_layer-ie6.png);
_background-position: -42px -96px;
}
.figure_area_handle p.left_rotation a:hover span {
background-image: url(/Public/images/photo_scan_layer-32.png);
background-position: -110px -25px;
_background-image: url(/Public/images/photo_scan_layer-ie6.png);
_background-position: -42px -73px;
}
.figure_area_handle p.right_rotation a:hover span {
background-image: url(/Public/images/photo_scan_layer-32.png);
background-position: -166px -25px;
_background-image: url(/Public/images/photo_scan_layer-ie6.png);
_background-position: -42px -119px;
}

.bigPhoto {
position: absolute;
top: 0;
left: 25px;
width: 612px;
height: 612px;
padding: 14px;
cursor: pointer;
}
.pic-load {
z-index: 8007;
position: absolute;
top: 305px;
left: 305px;
}

span.cal_month {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}

span.cal_month:hover{
	background-color:#eee;	
}
span.cal_active{
background-color:##0044cc;	
}
.table-condensed{
padding:4px 5px;	
}
table {
border-collapse: collapse;
border-spacing: 0;
}
th.switch {
width: 145px;
}
</style>
</head>

<body id="body">
<include file="./template/default/Public/header-logined.html" />

<script type="text/javascript">
var selected_image = '';
var dialog = '';
var global_index = '';
function showModal(day){
	//getAlbumByDay
	var current_pic = $('#'+day).attr("img_src");
	
	if(current_pic!="/Public/images/blank.gif"){
	dialog = art.dialog({
		lock: true,
		fixed: true,
		title:false,
		content:returnHtml(day),
		id:'modal',
		width:'960px',
		padding:0,
		background: '#000', // 背景色
   	 	opacity: 0.3,	// 透明度
		padding:0,
		
	});
	}
	setPreView();
}
function getImgIndex(s){
	
	//获取gallery图片数目
	var gallery_img  = $("#gallery img")
	var gallery_img_length = gallery_img.length;
	var g_i = 0;
	var ImgIndex = 0;

	var thumb_src = s.replace("imageMogr/v2/auto-orient/thumbnail/800x560","imageView/1/w/64/h/64");
	//alert(thumb_src+'---'+s);
	
	for(;g_i<gallery_img_length;g_i++){
		if(thumb_src==gallery_img[g_i].src){
			
			ImgIndex = g_i;
			break;
		}
	}
	
	return ImgIndex;
	
}


function returnHtml(day){

var str = '';
var src = '';
var src_big='',src_thumb='';
src = $('#'+day).attr('img_src');
src_big = src.replace('imageView/2/w/800','imageMogr/v2/auto-orient/thumbnail/800x560');
src_thumb = src.replace('imageView/2/w/800','imageMogr/v2/auto-orient/thumbnail/800x560/quality/15');

var html = '';
html+='<div class="bigPhoto" style="z-index:8006;opacity:0.5;filter:alpha(opacity=50);"><img src="'+src_thumb+'"></div>';
html+='<div class="pic-load"><img src="Public/images/pic-load.gif"></div>';
html+='<div class="bigPhoto" style="z-index:8008;background:none"><img src="'+src_big+'" data-json=\'{"":""}\' data_id="'+$('#'+day).attr('data_id')+'" id="viewpic_'+day+'" class="img_view" /></div>';


$('#_slideView_imgContainer').html(html);	
	

str = $('#bootDialog').html();

//gallery
//AJAX获取当月的所有图片数据
var month_obj = day.split("_");
var day_obj = month_obj[0].split("-");
LoadDayPic(day_obj[0],day_obj[1],day_obj[2],src_big);

loadImgInfo($('#'+day).attr('data_id'));//获取当前点击图片的ID

return str;	
}

function LoadDayPic(y,m,d,s){
	var month_str = '';
	var dstr = '';
	$.ajax({
	url:"/index.php",
		type:"GET",
		data:"s=/Home/Baby/FocusLoadDay/babyid/{$current_baby['baby_id']}/date/"+y+"-"+m+"-"+d+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			if(json){
			$.each(json,function(dataIndex,data){
				
				
				if(s=="http://facesbaby.u.qiniudn.com/"+data['photo_path']+"?imageMogr/v2/auto-orient/thumbnail/800x560"){
					gb_select = dataIndex;					
					month_str += '<li><a id="thumb_'+dataIndex+'" data_id="'+data['id']+'" onclick="selectView(\'http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/2/w/800/h/560\',\''+dataIndex+'\',\''+data['id']+'\')" class="link_view" href="javascript:void(0)"><img src="http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/1/w/64/h/64"  id="'+data['id']+'"></a></li>';
					$("#likeVal").attr("value",data['id']);
					dstr = data['photo_path'];
				}else{
					month_str += '<li><a id="thumb_'+dataIndex+'" data_id="'+data['id']+'" onclick="selectView(\'http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/2/w/800/h/560\',\''+dataIndex+'\',\''+data['id']+'\')" href="javascript:void(0)"><img src="http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/1/w/64/h/64" id="'+data['id']+'"></a></li>';
				}
				
				
			});
			}
			
			var total_width = 64*(json.length+1);
			$("#gallery").width(total_width);
			$("#gallery").html(month_str);
				
			roll_thumb(parseInt(getImgIndex(dstr)));
		}//end success
	});//end ajax
}


function setPreView(){
var xOffset = 10;//定义x的偏移量 
var yOffset = 20;//定义y的偏移量
var left_or_right = "";	
$(".img_view").mousemove(function(e){ 
var positionX=e.originalEvent.x-$(this).offset().left||e.originalEvent.layerX-$(this).offset().left||0;//获取当前鼠标相对img的x坐标 
var positionY=e.originalEvent.y-$(this).offset().top||e.originalEvent.layerY-$(this).offset().top||0;//获取当前鼠标相对img的y坐标，（以下用不着，可删除） 
var tipTitle;//定义提示标题 
if(positionX<=$(this).width()/2)//当当前鼠标相对x坐标小于图片宽度的一半时执行 
{ 
tipTitle='上一张'; 
$(this).addClass("left-img");
$(this).removeClass("right-img");
left_or_right = "left";
} 
else 
{ 
tipTitle='下一张'; 
$(this).removeClass("left-img");
$(this).addClass("right-img");
left_or_right = "right";
} 
$(this).attr("title","点击跳到"+tipTitle);
}
);

$(".img_view").click(function(e){	
	var gallery_img  = $("#gallery img")
	var gallery_img_length = gallery_img.length;
	global_index = getImgIndex($(this).attr("src"));
	if(global_index<gallery_img_length){
	//在范围内
		if(left_or_right=="left"){
			//上一个
			global_index = global_index-1;
		}else if(left_or_right=="right"){
			//下一个
			global_index = global_index+1;
		}
		
		
		
			if((global_index!=gallery_img_length)&&(global_index!=-1)){	
			//selectView(gallery_img[global_index].src.replace("_100x75.jpg",".jpg"),global_index,gallery_img[global_index].id);
			selectView(gallery_img[global_index].src.replace("1/w/64/h/64","2/w/800/h/560"),global_index,gallery_img[global_index].id);
			}else{
				//alert("没有了!");	
			}
		
	}
	
});	
}



function selectView(s,di,id){
//$("#likeVal").attr("value",id);
	if(gb_select==di){
		
	}else{
		$("#thumb_"+gb_select).removeClass("link_view");
		$("#thumb_"+di).addClass("link_view");
	}
	roll_thumb(parseInt(di));

var src_big='',src_thumb='';	
src_big = s.replace('imageView/2/w/800/h/560','imageMogr/v2/auto-orient/thumbnail/800x560');
src_thumb = s.replace('imageView/2/w/800/h/560','imageMogr/v2/auto-orient/thumbnail/800x560/quality/15');

	var html = '';
html+='<div class="bigPhoto" style="z-index:8006;opacity:0.5;filter:alpha(opacity=50);"><img src="'+src_thumb+'"></div>';
html+='<div class="pic-load"><img src="Public/images/pic-load.gif"></div>';
html+='<div class="bigPhoto" style="z-index:8008;background:none"><img src="'+src_big+'" data-json=\'{"":""}\' class="img_view" /></div>';
	
	$('#_slideView_imgContainer').html(html);
	$('.img_view').fadeIn("slow");	
	gb_select = di;
	loadImgInfo(id);
	setPreView();
}
function loadImgInfo(id){
//AJAX获取相片的相关评论内容
	//opacity:1; likeBtn
	
	getPhotoDt(id);
	getLike(id);//获取是否赞
	likelist(id);//获取列表
	//列表评论
	listcomment(id);
	$('#likeVal').val(id);
	
	
}

function getPhotoDt(id){
	$.ajax({
	url:'/index.php',
	type:'GET',
	data:'s=/Home/Albums/PhotoDt/photoid/'+id,
	dataType:'json',
	success:function(json){
		var shootingdate = new Date(json['photo_createdate']*1000);
		$('#dateDetail').html(shootingdate.format("yyyy-MM-dd hh:mm:ss"));
		$('#photo_topic').html(json['photo_topic']);
		
		
		
	}
	});
}

function likelist(id){
	$.ajax({
	url:"/index.php",
	type:"GET",
	data:"s=/Home/Index/likelist/photoid/"+id+"/tp/"+new Date().getTime(),
	dataType:"json",
	success:function(json){
		if(json){
			var str = '';
			$.each(json,function(dataIndex,data){
				str+='<li><a href="#" target="_blank"><i class="icon-heart"></i>'+data.username+'</a></li>';
			});
			$("#dropdown-menu").html(str);
		}
	}
	});
}

function getLike(id){
	//$("#likeVal").attr("value",id);
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:"s=/Home/Demo/getLike/photoid/"+id+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			if(json){
				if(json['likeit']==1){
					$("#likeBtn").css('opacity','1');
				}else{
					$("#likeBtn").css('opacity','0.5');
				}
				var like_count = json['like_count'];
				if(like_count!=0){
				$('#likeit_num').html(json['like_count']);
				}else{
					$('#likeit_num').html('');
				}
			}else{
				$("#likeBtn").css('opacity','0.5');
			}
		}
			
	});
}

function Like(obj){
	var opacity = $('#likeBtn').css("opacity");
	var url = '';
	var id = $('#likeVal').val();
	

	if(opacity==0.5){
		url = 's=/Home/Baby/FocusLike/babyid/{$current_baby['baby_id']}/photoid/'+id+'/tp/'+new Date().getTime();
	}else{
		url = 's=/Home/Baby/FocusUnlike/babyid/{$current_baby['baby_id']}/photoid/'+id+'/tp/'+new Date().getTime();
	}
	
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:url,
		dataType:"json",
		success:function(json){
			
			if(json['flag']==1){
				
				if(opacity==0.5){
					$('#likeBtn').css("opacity","1");
				}else{
					$('#likeBtn').css("opacity","0.5");
				}
				var like_count = json['like_count'];
				if(like_count!=0){
				$('#likeit_num').html(like_count);
				}else{
					$('#likeit_num').html('');
				}
			}
		}
	});
}
var pre_i = 0;	
function roll_thumb(di){
	var i=0;
	var gallery_li  = $("#gallery li")//获得缩略图列表对象
	var gallery_li_length = gallery_li.length;//获得所有缩略图相片
	if(di<gallery_li_length){
	var j=di;
var movePos = ((44)*(-di));//

$("#gallery").animate({left:movePos},400); 	

	}
}
</script>
<style type="text/css">
#gallery li{
	float:left;
	list-style:none;
}
.photo_figure{
width:960px;
overflow:hidden;
margin:0 auto;
position:relative;
}
.figure_area {
min-width: 270px;
_width: 270px;
width:740px;
height: 580px;
position: relative;
overflow: hidden;
float:left;
}
.figure_side {
text-align: left;
width: 220px;
height: 580px;
padding: 0 25px;
overflow-y: auto;
overflow-x: hidden;
position: absolute;
right: 0;
top: 0;
background: #ECECEC;
}
.figure_slidview{
width:950px;
overflow:hidden;
margin:0 auto;
height: 50px;
}
</style>

<div style="display:none" id="bootDialog">
	<div class="photo_figure">
    <div class="photo_layer_close"><a onClick="dialog.close();" href="javascript:void(0)" title="关闭">关闭</a></div>
    <div class="figure_main">
    
    	<div class="figure_area">
        
        <div class="figure_img" id="_slideView_imgContainer" style=" position:relative;text-align:center">
        	
        </div>
        
<!--<div style="position:relative" id="figure_area_block">

</div>-->
        
        
        
        </div>
        <div class="figure_side" style="overflow:hidden">
        
        
        <div class="clear user" id="_slideView_userinfo" style="height:40px"><p class="user_img"><a href="http://user.qzone.qq.com/4046368" target="_blank"><img style="width:40px;height:40px" src="<?php if(empty($_SESSION['session_fb'][0]['baby_icon'])){echo '/Public/images/smile.png';}else{echo $_SESSION['session_fb'][0]['baby_icon'];}?>"></a></p><div class="user_photo_details"><p><a href="/index.php?s=/Home/Baby/setting/BB/<?php echo $_SESSION['session_fb'][0]['baby_id']?>" target="_blank" class="user_nickname"><?php echo $_SESSION['session_fb'][0]['baby_realname']?></a></p><p><strong id="dateDetail"></strong></p></div></div>
        
        <div class="figure_description c_tx2" id="_slideView_description" style="height: 48px; overflow: hidden;"><div id="_slideView_description_inner"><div class="qz_311_content" id="photo_topic"></div></div></div>
        
        <div class="detailStats">
                <div class="btn-group">
                    <input type="hidden" id="likeVal"><a class="btn btn-danger likeDropDownButton likeButton tooltipBtn" href="javascript:Like(this);" id="likeBtn">
                    	<i class="icon-heart icon-white"></i>
                        <span id="likeit_num"></span></a>
                    <a onclick="likelist($('#likeVal').val())" class="btn dropdown-toggle" data-toggle="dropdown">
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" id="dropdown-menu"></ul>
                </div>
<script type="text/javascript">
function postcomment(){
	//addComment
	var id = $('#likeVal').val();
	var comment = $.trim($("#addComment").val());
	$.ajax({
		type:"POST",
		url:"/index.php?s=/Home/Comment/PostComment",
		dataType:"json",
		data:"photoid="+id+'&comment='+comment+'&tp='+new Date().getTime(),
		success:function(json){
			if(json['flag']=='success'){
				listcomment(id);
			}else if(json['flag']=='fail'){
				alert('评论失败!');
			}
		}
	});
}
function listcomment(id){
//列出该相片的评论
var photoid = $('#likeVal').val();	
$.ajax({
type:"GET",
url:"/index.php?s=/Home/Comment/ListComment/photoid/"+id+"/tp/"+new Date().getTime(),
dataType:"json",
success:function(json){
	var str = '';
	if(json.length>0){
	$.each(json,function(dataIndex,data){
		if(data['user_id']=='{$_SESSION["session_id"]}'){
		str+='<div class="comment"><span>'+data['realname']+':</span>'+data['memo']+'<a onclick="delComment(\''+data['id']+'\')" href="javascript:void(0)">删除</a></div>';
		}else{
			str+='<div class="comment"><span>'+data['realname']+':</span>'+data['memo']+'</div>';
		}
	});
	}else{
		str = '<div class="comment">暂时还没有评论!</div>';
	}
	$('#detailComments').html(str);
}
});
}
function getPreComment(){
	$("#loadingComments").show();
	$("#showAllComments").hide();
	var photoid = $('#likeVal').val();
	$.ajax({
type:"GET",
url:"/index.php?s=/Home/Comment/ListComment/photoid/"+photoid+"/tp/"+new Date().getTime(),
dataType:"json",
success:function(json){
	var str = '';
	if(json.length>0){
	$.each(json,function(dataIndex,data){
		if(data['user_id']=='{$_SESSION["session_id"]}'){
		str+='<div class="comment"><span>'+data['realname']+':</span>'+data['memo']+'<a onclick="delComment(\''+data['id']+'\')" href="javascript:void(0)">删除</a></div>';
		}else{
			str+='<div class="comment"><span>'+data['realname']+':</span>'+data['memo']+'</div>';
		}
	});
	}else{
		str = '<div class="comment">暂时还没有评论!</div>';
	}
	$("#loadingComments").hide();
	$("#showAllComments").show();
	$('#detailComments').html(str);
}
});
}
</script>

                <a onclick="postcomment()" href="javascript:void(0)" class="sendButton btn btn-success"><i class="icon-comment icon-white"></i>评论</a>
            </div>
            
            <div class="addCommentContainer">
                <textarea class="addComment" cols="20" id="addComment" name="addComment" placeholder="评论" rows="2"></textarea>
                <div id="loadingComments" class="loadingComments" style="display:none">
                    <img src="/Public/images/ajax-loader-arrow.gif" alt="">
                </div>
                <a onclick="getPreComment();" href="javascript:void(0);" id="showAllComments" class="showAllComments" style="display: block;"><i class="icon-chevron-down"></i>查看所有评论</a>
            </div>
            
            <div class="detailComments" id="detailComments" style="height:295px;overflow:hidden;padding:0px;width:230px;">
            	
            </div>
        
        </div>
    </div><!--end figure_main-->  
    <div class="figure_slidview clearfix">
    <ul id="gallery" style=" position:absolute"></ul>
    </div>
    </div><!--end figure-->
</div>
<!--end bootDialog-->

<div id="calendar" style="margin:0 auto;font-size:13px;background:#fff" class="fc">
<header><div class="cal_top cal_top_mon"><ul class="view_type right"><li>
  <a href="/index.php?s=/Home/Index/index/year/{$_GET['year']}" title="切换到年模式浏览"><i class="icon-th"></i>切换到年模式浏览</a></li>
</ul><div class="left">

<a tabindex="-1" class="btn_blue btn_addevent" href="javascript:;" ck="editEventFrame" id="a_newevent" title="新建事件"><span class="ico_addevent"></span></a><a tabindex="-1" ck="sync2mobile" class="btn_gray btn_onlyicon" href="javascript:;" title="同步到手机"><span class="ico_mobile"></span></a></div><div id="title-2012-11" class="g_title"><a class="btn_pre" href="/index.php?s=/Home/Baby/Calendar/year/{$last_year}/month/{$last_month}" ck="goMonth" to="-1" title="上一月"><span class="arrow_l"></span></a>
<h1>
<a class="btn" data-toggle="popover" href="javascript:void(0)" data-placement="bottom" id="btn_calendar">{$year}年{$month}月</a>

</h1><a class="btn_next" href="/index.php?s=/Home/Baby/Calendar/year/{$next_year}/month/{$next_month}" ck="goMonth" title="下一月"><span class="arrow_r"></span></a></div>


</div></header>


<div id="calendar_body">
{$calendar}
</div>


</div>
<style type="text/css">
span.cal_month {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}

span.cal_month:hover{
	background-color:#eee;	
}
span.cal_active{
background-color:##0044cc;	
}
.table-condensed{
padding:4px 5px;	
}
table {
border-collapse: collapse;
border-spacing: 0;
}
th.switch {
width: 145px;
}
</style>
<script type="text/javascript">
var lie = '';
var hang = '';
var current_option_year = {$_GET['year']};	
function jump_month(m){
location.href='/index.php?s=/Home/Baby/Calendar/year/'+current_option_year+'/month/'+m+'';	
}
function cal_month(){
var month_name = new Array('1','2','3','4','5','6','7','8','9','10','11','12');
var month_span = '';
$.each(month_name,function(dataIndex,data){
	month_span+='<span class="cal_month"><a onclick="jump_month(\''+data+'\')" href="javascript:void(0)">'+data+'月</a></span>';
});
var cal_body = '<table class="table-condensed"><tr><td>'+month_span+'</td></tr></table>';
return cal_body;	
}
function year_op(op){
	if(op=='prev'){
		current_option_year=current_option_year-1;
	}else if(op=='next'){
		current_option_year=current_option_year+1;
	}
	
	$("#c_year").html(current_option_year);
}

function year_options(){


var cal_year_options_header = '<div><table class="table-condensed" width="100%"><thead><tr><th class="prev" style="visibility: visible;"><a onclick="year_op(\'prev\')" href="javascript:void(0)"><i class="icon-arrow-left"></a></i></th><th colspan="5" class="switch"><span id="c_year">'+current_option_year+'</span></th><th class="next" style="visibility: visible;"><a onclick="year_op(\'next\')" href="javascript:void(0)"><i class="icon-arrow-right"></i></a></th></tr></thead></table></div>';	
return cal_year_options_header;
}

function year_select(){
	var cal_year_select = '<div></div>';
	return cal_year_select;
}

$(document).ready(function(){
	
	$('#btn_calendar').popover({title:year_options,html:true,content:cal_month});
	
	$('.album_day').bind('click',function(){
		//getAlbumByDay($(this).attr('date'));

		//showModal($(this).attr('date'));
		
		if($("#photo_"+$(this).attr('date')).size()>0){
			//存在
			var html = $("#photo_"+$(this).attr('date')).html();
			var photo_date_body = '<div id="anchor_'+$(this).attr('date')+'"><a href="#anchor_'+$(this).attr('date')+'"></a><div id="photo_'+$(this).attr('date')+'" style="border-top:1px solid #ccc;">'+html+'</div></div>';	
			
			
			$("#photo_"+$(this).attr('date')).remove();
			$("#mark_"+$(this).attr('row')).prepend(photo_date_body);
			
			
		}else{
			//不存在
			var photo_date_body = '<div id="anchor_'+$(this).attr('date')+'"><a href="#anchor_'+photo_date_body+'"></a><div id="photo_'+$(this).attr('date')+'" style="border-top:1px solid #ccc;"></div></div>';	
			$("#mark_"+$(this).attr('row')).prepend(photo_date_body);
			$("#row_"+$(this).attr('row')).show();
			//进行ajax数据获取
			PhotoByDay($(this).attr('date'));
			
		}
		$(".goTop").anchorGoWhere({target:1});
	});
	
	$(".album_day").anchorGoWhere({target:1});
	
});

function PhotoByDay(day){
	var str = '';
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:"s=/Home/Baby/listDayPhoto/day/"+day+"/baby_id/"+babyInfo['baby_id']+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			if(json.length>0){
			$.each(json,function(dataIndex,data){
				
				str+='<li><a img_src="http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/2/w/800" data_id="'+data['id']+'" id="'+day+'_'+dataIndex+'" href="javascript:void(0)" class="img_rel"><img src="http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/1/w/50/h/38" width="50" height="38" border="0" class="img" style="visibility: visible;"></a></li>';
				

			});
			}else{
				str='<li><img src="/Public/images/smile.png" width="52" height="40"></li>';	
			}
			$('#photo_'+day).html('<div><h2 class="dayTitle"><a href="#body" class="goTop" title="返回顶部"><i class="icon-arrow-up"></i></a>'+day+'</h2><ul>'+str+'</ul></div>');
			
			$('.img_rel').bind('click',function(){
				showModal($(this).attr('id'));
			});
			
		}
	});	
}

function viewPic(u){
$('#_slideView_imgContainer').html('<img src="'+u.replace('_100x75.jpg','.jpg')+'" id="viewpic" onload="DrawImage(this,800,580)" />');
}

function getAlbumByDay(day){
	//获得当天所拍的相片
	var new_day = day.split("_");
	
	var str = '';
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:"s=/Home/Baby/listDayPhoto/day/"+day+"/baby_id/"+babyInfo['baby_id']+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			
			$.each(json,function(dataIndex,data){
				
				str+='<li><a onclick="viewPic(\''+data['photo_path']+'\')" href="javascript:void(0)" rel="prettyPhoto[gallery1]" title="'+data['photo_topic']+'"><img src="http://facesbaby.u.qiniudn.com/'+data['photo_path']+'?imageView/1/w/64/h/64" width="60" height="60" alt="'+day+'" /></a></li>';
				
			});
			$('#gallery').html(str);
			
			//$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square'});
		}
	});	
}

function load_pre_mon(str){
//获取上个月的
	//
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:"s=/Home/Baby/listPointPhoto/detail/"+str+"/baby_id/"+babyInfo['baby_id']+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			
			$.each(json,function(dataIndex,data){

				$('#'+data['photo_year']+'-'+data['photo_month']+'-'+data['photo_day']).attr("src","http://facesbaby.u.qiniudn.com/"+data['photo_path']+"?imageView/1/w/108/h/81");
				$('#t-'+data['photo_year']+'-'+data['photo_month']+'-'+data['photo_day']).html(data['photo_topic']);
			});
		}
	});	
}


function load_current_mon(){
	$.ajax({
		url:"/index.php",
		type:"GET",
		data:"s=/Home/Baby/getPhoto/y/{$year}/mon/{$month}/baby_id/"+babyInfo['baby_id']+"/tp/"+new Date().getTime(),
		dataType:"json",
		success:function(json){
			
			$.each(json,function(dataIndex,data){
				$('#'+data['photo_year']+'-'+data['photo_month']+'-'+data['photo_day']).attr("src","http://facesbaby.u.qiniudn.com/"+data['photo_path']+"?imageView/1/w/108/h/81");
				$('#t-'+data['photo_year']+'-'+data['photo_month']+'-'+data['photo_day']).html(data['photo_topic']);
			});
		}
	});	
}
load_current_mon();
load_pre_mon('{$pre_month_day}');
load_pre_mon('{$next_month_day}');

</script>
<include file="./template/default/Public/footer-logined.html" />

<!--<ul class="gallery clearfix">
				<li><a href="/prettyPhoto/images/fullscreen/1.JPG?lol=lol" rel="prettyPhoto[gallery1]" title="You can add caption to pictures. You can add caption to pictures. You can add caption to pictures."><img src="/prettyPhoto/images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a></li>
				<li><a href="/prettyPhoto/images/fullscreen/2.jpg" rel="prettyPhoto[gallery1]"><img src="/prettyPhoto/images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a></li>
				<li><a href="/prettyPhoto/images/fullscreen/3.jpg" rel="prettyPhoto[gallery1]"><img src="/prettyPhoto/images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" /></a></li>
				<li><a href="/prettyPhoto/images/fullscreen/4.jpg" rel="prettyPhoto[gallery1]"><img src="/prettyPhoto/images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" /></a></li>
				<li><a href="/prettyPhoto/images/fullscreen/5.jpg" rel="prettyPhoto[gallery1]"><img src="/prettyPhoto/images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" /></a></li>
				<li><a href="/prettyPhoto/images/fullscreen/6.jpg" rel="prettyPhoto[gallery1]"><img src="/prettyPhoto/images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a></li>
			</ul>-->
			<script type="text/javascript" charset="utf-8">
		/*	$(document).ready(function(){
				
				$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: true});
//				$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
		
			
				
			});*/
			</script>

</body>
</html>